
#ifndef _WIN32GLUT_HPP_
#define _WIN32GLUT_HPP_


#include "gl/glut.h"
#pragma comment(lib,"glut32.lib")


namespace wintoolkit
{
struct GLUTWindows;
typedef int Argc;
typedef char** Argv;


template<class T>
inline void set( Argc argc,  Argv argv);
template<>
inline void set<GLUTWindows>( Argc argc,  Argv argv)
{ 
glutInit            ( &argc, argv ); // Erm Just Write It =)
glutInitDisplayMode ( GLUT_RGBA | GLUT_DOUBLE ); // Display Mode
glutInitWindowSize  ( 500, 500 ); // If glutFullScreen wasn't called this is the window size
glutCreateWindow    ( " OpenGL Framework" ); 
//glutFullScreen      ( );          
}


//CallBack  
template< class T0, class T1>
inline void set(T1 func);
struct Display;
template<class T>
struct CallBack;
template<>
struct CallBack<Display>
{
typedef void (GLUTCALLBACK *func_type)(void);
};
typedef CallBack<Display> DisplayCallBack;
template<>
inline void set<DisplayCallBack>(DisplayCallBack::func_type func)
{
glutDisplayFunc     ( func );  
}


struct Reshape;
template<>
struct CallBack<Reshape>
{
typedef void (GLUTCALLBACK *func_type)(int width, int height);
};
typedef CallBack<Reshape> ReshapeCallBack;
template<>
inline void set<ReshapeCallBack>(ReshapeCallBack::func_type func)
{
glutReshapeFunc     ( func );
}


struct Keyboard;
template<>
struct CallBack<Keyboard>
{
typedef void (GLUTCALLBACK *func_type)(unsigned char key, int x, int y);
};


typedef CallBack<Keyboard> KeyboardCallBack;
template<>
inline void set<KeyboardCallBack>(KeyboardCallBack::func_type func)
{
glutKeyboardFunc    ( func );


}


struct Idle;
template<>
struct CallBack<Idle>
{
typedef void (GLUTCALLBACK *func_type)(void);
};


typedef CallBack<Idle> IdleCallBack;
template<>
inline void set<IdleCallBack>(IdleCallBack::func_type func)
{
glutIdleFunc  ( func );
}


}
















#endif